<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>技术问题</title>
    <link rel="stylesheet" href="media/layui/css/layui.css">
</head>
<body>
<form>
    <table>
        <tr>
            <td><label style="color:red"> 学员姓名： </label></td>
            <td><span id="uname"></span></td>
        </tr>

        <tr>
            <td><label style="color:red"> 问题内容： </label></td>
        </tr>

        <tr>
            <td></td>
            <td><textarea placeholder="请输入技术内容" style="width:592px;height:150px;" id="content" name="content"></textarea></td>
        </tr>
    </table>

    <button type="submit" class="layui-btn">申请</button>
</form>

<script src="media/layui/layui.js"></script>
<script src="media/js/jquery.min.js"></script>
<script>
    $("form").submit(function () {
        $.ajax({
            type:"get",
            url:"http://localhost:8080/OaNew/skill/add.do",
            data:$("form").serialize(),
            success:function (data) {
                alert(data.info)
                window.location.reload()
            }
        })
        return false
    })

    $(function () {
        $.ajax({
            type: "get",
            url: "http://localhost:8080/OaNew/user/query.do",
            dataType: "json",
            success: function(data) {
                console.log(data)
                if (data.code == 1) {
                    $("#uname").html(data.info)
                } else {
                    layer.msg("获取数据异常")
                }
            }
        })
    })
</script>
</body>
</html>
